package br.com.ordersys.web.i18n;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class I18nTag extends SimpleTagSupport {
	private String bundleName;
	
	public void doTag() throws JspException, IOException {
		PageContext ctx = (PageContext) getJspContext();
	    JspWriter out = ctx.getOut();
	    
	    out.println(I18nDictionaryBuilder.declare(bundleName,ctx.getRequest().getLocale()));
	}

	public void setBundleName(String bundleName) {
		this.bundleName = bundleName;
	}
}
